/**
 * Copyright (c) 2008,中企动力华南研发中心
 * All rights reserved.
 */
package com.ce.pms.customer.service.impl;

import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.ce.pms.base.service.impl.PmsBaseServiceImpl;
import com.ce.pms.customer.dao.IChooseSingleHouseDao;
import com.ce.pms.customer.service.IChooseSingleHouseService;
import com.sitechasia.webx.core.exception.BizLayerException;
/**
 * 逻辑、功能相关描述:
 * @author 易贤建  编写日期：2008-5-22
 */

public class ChooseSingleHouseServiceImpl extends PmsBaseServiceImpl implements IChooseSingleHouseService {
	IChooseSingleHouseDao chooseSingleHouseDao = null;
	/**
     * Function:根据楼栋ID找到房屋列表。
     * Create author:yixianjian
     * Create on:2008-5-22
	 */
	public List selectMemberByBld(Long buildId,Long houseGrpId) {
		if(StringUtils.isBlank(String.valueOf(buildId)))
			throw new BizLayerException( "楼栋ID不能为空");
		if(houseGrpId != null)
			return chooseSingleHouseDao.findMember(buildId,houseGrpId);
		return chooseSingleHouseDao.findMember(buildId);
	}

	/**
	* Function:  根据楼栋ID，查询相关房屋列表。注：该方法在设计属于房产那块，但为了保证进度，现在这里实现。
	* @param 楼栋ID
	* @return 房屋列表
	* Create author:yixianjian
	* Create on:2008-5-26
	 */
	public List selectBuilding(Long areaId){
		if(StringUtils.isBlank(String.valueOf(areaId)))
			throw new BizLayerException("楼栋ID不能为空");
		return chooseSingleHouseDao.getBuildingList(areaId);
	}

	/**
	* Function:通过房屋ID查询相关业主姓名
	* @param
	* @return
	* Create author:yixianjian
	* Create on:2008-6-17
	* Edit author:
	* Edit on:
	* Why:
	 */
	public List findClientNameByHouseId(Long houseId){
		if(houseId == null)
			throw new BizLayerException("房号不能为空");
		return chooseSingleHouseDao.findClientNameByHouseId(houseId);
	}
	public void setChooseSingleHouseDao(IChooseSingleHouseDao chooseSingleHouseDao) {
		this.chooseSingleHouseDao = chooseSingleHouseDao;
	}

}
